package com.hua.api.modules.message.dao;

import com.hua.api.core.constants.Status;
import com.hua.api.core.framework.statement.EntityManagerTemplate;
import com.hua.api.core.framework.statement.Statement;
import com.hua.api.core.framework.statement.mysql.StatementFactoryImpl;
import com.hua.api.modules.express.domain.ExpressOrder;
import com.hua.api.modules.message.domain.SmsSender;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public class SmsSenderDao extends EntityManagerTemplate {

    public List<SmsSender> queryNeedSendSms(Date beginDate) {
        Statement statement = StatementFactoryImpl.getInstance().createStatement(" from SmsSender s where s.state=?1 and s.createdTime>=?2 and s.failtime<?3");
        statement.addParams(Status.LOGIC_N,beginDate,3);
        return query(statement,20,SmsSender.class);
    }

}
